#include"processBar.h"
typedef void (*callback)(int);

void download(callback cb){
  int total=1000;
  int cur=0;
  while(cur<=total){
    usleep(50000);
    int rate=cur*100/total;
    cb(rate);
    cur+=10;
  }
  printf("\n");
}

int main(){
  printf("download1:\n");
  download(processbar);
  initbar();
  printf("download2:\n");
  download(processbar);
  initbar();
  printf("download3:\n");
  download(processbar);
  initbar();
  printf("download4:\n");
  download(processbar);
  initbar();
  return 0;
}
